package za.ac.lance.encapsulation.service.impl;

import za.ac.lance.encapsulation.model.Person;
import za.ac.lance.encapsulation.service.PersonService;

/**
 * File Name: PersonImpl.java
 * Version:
 * Description:
 * Package: za.ac.lance.encapsulation.service.impl
 * Author: Lance
 * Date: Feb 23, 2012
 */
public class PersonImpl implements PersonService
{

    @Override
    public String computInitials(Person person)
    {
        String firstName = person.getFirstName();
        String middleName = person.getMiddleName();
        String lastName = person.getLastName();
        String initials = firstName.substring(0, 1) + middleName.substring(0, 1) + lastName.substring(0, 1);

        return initials.toUpperCase();
    }
}
